/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2024-12-04     huger       the first version
 */
#ifndef APPLICATIONS_APP_APP_TFT_H_
#define APPLICATIONS_APP_APP_TFT_H_


#include "bsp/bsp_uart2.h"
#include "bsp/bsp_uart3.h"
#include "bsp/bsp.h"

#define  Channel1_On_Off_Status_Add            0x1200
#define  Channel1_Optical_Ctl_Sync_Status_Add   0x1210
#define  Channel1_Voice_Signal1_On_Off_Status_Add          0x1220
#define  Channel1_Voice_Signal2_On_Off_Status_Add          0x1230
#define  Channel1_Voice_Optical_Sync_Status_Add          0x1240

#define  Channel1_Optical_Ctrl_Frequency_Add   0x1000
#define  Channel1_Optical_Ctrl_Pwmduty_Add   0x1008

#define  Channel1_Optical_Ctrl_On_Time_High_Add   0x1010
#define  Channel1_Optical_Ctrl_On_Time_low_Add   0x1018

#define  Channel1_Optical_Ctrl_Off_Time_High_Add   0x1020
#define  Channel1_Optical_Ctrl_Off_Time_Low_Add   0x1028

#define  Channel1_One_Session_Time_High_Add              0x1030
#define  Channel1_One_Session_Time_Low_Add              0x1038
#define  Channel1_One_Session_Interval_Time_High_Add   0x1040
#define  Channel1_One_Session_Interval_Time_Low_Add   0x1048

#define  Channel1_Optical_Ctrl_Cycle_Times_Add   0x1050

#define  Channel1_Optical_Random_Frequence1_Add   0x1058
#define  Channel1_Optical_Random_Frequence2_Add   0x1060

#define  Channel1_Voice_Signal1_Frequence_Add              0x1068
#define  Channel1_Voice_Signal2_Frequence_Add              0x1070

#define  Channel1_Voice_Signal_Time_Lag_Add              0x1078


#define  Channel2_On_Off_Status_Add            0x1300
#define  Channel2_Optical_Ctl_Sync_Status_Add   0x1310
#define  Channel2_Voice_Signal1_On_Off_Status_Add          0x1320
#define  Channel2_Voice_Signal2_On_Off_Status_Add          0x1330
#define  Channel2_Voice_Optical_Sync_Status_Add          0x1340

#define  Channel2_Optical_Ctrl_Frequency_Add   0x1100
#define  Channel2_Optical_Ctrl_Pwmduty_Add   0x1108

#define  Channel2_Optical_Ctrl_On_Time_High_Add   0x1110
#define  Channel2_Optical_Ctrl_On_Time_low_Add   0x1118

#define  Channel2_Optical_Ctrl_Off_Time_High_Add   0x1120
#define  Channel2_Optical_Ctrl_Off_Time_Low_Add   0x1128

#define  Channel2_One_Session_Time_High_Add              0x1130
#define  Channel2_One_Session_Time_Low_Add              0x1138
#define  Channel2_One_Session_Interval_Time_High_Add   0x1140
#define  Channel2_One_Session_Interval_Time_Low_Add   0x1148

#define  Channel2_Optical_Ctrl_Cycle_Times_Add   0x1150

#define  Channel2_Optical_Random_Frequence1_Add   0x1158
#define  Channel2_Optical_Random_Frequence2_Add   0x1160

#define  Channel2_Voice_Signal1_Frequence_Add              0x1168
#define  Channel2_Voice_Signal2_Frequence_Add              0x1170

#define  Channel2_Voice_Signal_Time_Lag_Add              0x1178



typedef struct {
    uint8_t   On_Off_status;  //通道开关状态

    uint32_t  Optical_ctrl_frequency ;//光控信号基频
    uint16_t  Optical_ctrl_pwmduty ;  //光控信号占空比

    uint16_t  Optical_ctrl_on_time;   //光控调制信号 on时间
    uint16_t  Optical_ctrl_off_time;  //光控调制信号 off时间

    uint16_t  One_session_time;                //一次执行时间
    uint16_t  One_session_interval_time;       //一次执行时间间隔

    uint16_t  Optical_ctrl_cycle_times;  //光控循环次数
    uint16_t  Optical_ctl_sync_status;   //光同步

    uint16_t  Optical_random_frequence1;  //光控随机频率1
    uint16_t  Optical_random_frequence2;  //光控随机频率2

    uint32_t  Voice_signal1_frequence;    //声音刺激1频率
    uint16_t  Voice_signal1_on_off_status; //1状态
    uint32_t  Voice_signal2_frequence;    //声音刺激1频率
    uint16_t  Voice_signal2_on_off_status; //1状态

    uint32_t  Voice_signal_time_lag;  //时间差

    uint16_t  Voice_optical_sync_status; //声光同步状态

}SOICE_OPTICAL;

void tft_init(void);

#endif /* APPLICATIONS_APP_APP_TFT_H_ */
